package com.yunhe.tianhe.rentcars.service.system.impl;

import com.yunhe.tianhe.commons.dto.Pageable;
import com.yunhe.tianhe.rentcars.dao.system.BusiLogDao;
import com.yunhe.tianhe.rentcars.entity.system.BusiLog;
import com.yunhe.tianhe.rentcars.service.system.BusiLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * # @Author: 贾波
 * # @Time:上午 11:18 2017/11/29 0029
 * # Description:
 */
@Service
public class BusiLogServiceImpl implements BusiLogService {
@Autowired
private BusiLogDao busiLogDao;

    public void save(BusiLog busiLog) {
     busiLogDao.save(busiLog);
    }

    public Pageable<BusiLog> findPageList(Long offset, Long limit, String busiName, String busiType, Date start, Date end) {
        List<BusiLog> pageList = busiLogDao.findPageList(offset, limit, busiName, busiType, start, end);
        Long count = busiLogDao.pageCount();
        Pageable<BusiLog> pageable= new Pageable<>();
        pageable.setRows(pageList);
        pageable.setTotal(count);
        return pageable;
    }
}
